void Input(float* pa, int* n) {
    *n = 0;
    while ((*n) < 10) {
        scanf("%f", &pa[*n]);
        if (pa[*n] == 9999)
            break;
        if (pa[*n] < 0 || pa[*n] > 100 )
            continue;
        (*n)++;
        }
    return;
}

float Average(float* pa, int n) {
    if (!n)
        return 0;
    float sum = 0.0;
    for (int i = 0; i < n; i++) {
        sum += pa[i];
    }
    sum /= n;
    return sum;
}


//降序排序
void Sort(float* pa, int n) {
    //直接插入
    for (int i = 1; i < n; i++) {
        int end = i - 1;
        float key = pa[i];
        while (end >= 0 && key > pa[end]) {
            pa[end + 1] = pa[end];
            end--;
        }
        if (end + 1 != i)
            pa[end + 1] = key;
    }
    return;
}